package viewcomponents;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.*;
import java.util.*;
import java.util.List;

import javax.swing.*;

import controller.Controller;

import model.turtle.Position;
import model.turtle.Turtle;
import view.Observer;


public class SLogoCanvas extends JPanel implements Observer
{
	//private int DEFAULT_SIZE = 600;
	private JPanel myCanvas;
	private CommandInput myCommandInput;
	private TurtleCanvas myTurtleCanvas;
	private Controller myController;

	public SLogoCanvas(Controller controller)
	{
		createCanvas(controller);
	}
	
	public JPanel getCanvas()
	{
		return myCanvas;
	}
	
	
	private void createCanvas(Controller controller)
	{		
		//setPreferredSize(new Dimension(DEFAULT_SIZE,DEFAULT_SIZE));
		myController = controller;
		myTurtleCanvas = new TurtleCanvas();
		add(myTurtleCanvas, BorderLayout.NORTH);
		
		myCommandInput = new CommandInput(myController);
		add(myCommandInput, BorderLayout.SOUTH);
		
		setVisible(true);
		
	}
	
	public String getInput()
	{
		return myCommandInput.getInput();
	}
	
	public void drawMovement(int x0, int y0, int x1, int y1)
	{
		
	}
	
	public void moveTurtle(int x0, int y0, int x1, int y1)
	{
		
	}
	
	public void turnTurtle(int degree)
	{
		
	}
	
	public void toggleTurtle(boolean flag)
	{
		
	}
	
	public void reset()
	{
		
	}
	
	public void refresh()
	{
		
	}

	@Override
	public void update(List<Turtle> turtles)
	{
		//addActionListener(this);
		
	}
	
}
